package com.IntelligentCommunity.algorithm.api.factory;

import com.IntelligentCommunity.algorithm.api.AlgorithmRemote;
import com.IntelligentCommunity.algorithm.domain.FaceImgResponse;
import com.IntelligentCommunity.algorithm.domain.FaceRecognitionConf;
import com.IntelligentCommunity.algorithm.domain.request.FaceAddRequest;
import com.IntelligentCommunity.common.core.domain.R;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author 美国五星上将麦克阿瑟
 */
@Component
public class AlgorithmFallbackFactory implements FallbackFactory<AlgorithmRemote> {
    @Override
    public AlgorithmRemote create(Throwable cause) {
        return new AlgorithmRemote() {
            @Override
            public R faceInsert(FaceAddRequest faceAddRequest) {
                return R.fail();
            }

            @Override
            public R faceRec(FaceRecognitionConf faceRecognitionConf) {
                return R.fail();
            }

            @Override
            public R<FaceImgResponse> faceFindBySubject(String subjectName) {
                return R.fail();
            }

            @Override
            public R faceDet(FaceRecognitionConf faceRecognitionConf) {
                return R.fail();
            }

            @Override
            public R delBySubject(String subject) {
                return R.fail();
            }

            @Override
            public R faceInsertBath(List<FaceAddRequest> faceAddRequestList) {
                return R.fail();
            }

            @Override
            public R delBySubjects(List<String> subjects) {
                return R.fail();
            }
        };
    }
}
